// yarn add styled-components
// https://mp.weixin.qq.com/s/oywTpNKEikMXn8QTBgITow
import React, { PureComponent } from "react";
import styled from "styled-components";


const HYdiv = styled.div.attrs({
     myColor:"red",   //静态的参数
     myBGColor:'gold'
})`
    background-color:${props=>props.myBGColor};
    color:${props=>props.myColor};
`

class Index extends PureComponent {
    render(){
        return(
            <HYdiv>
            12312312
            </HYdiv>
        )
    }
}

export default Index;
